package com.zx.mobile.service.proxy;

import com.zx.mobile.domain.HistoryPaycardInfoResponse;
import com.zx.mobile.domain.HistoryPaycardRequest;
import org.apache.commons.lang3.StringUtils;

public class HistoryPaycardCommonProxy {

    /**
     * 历史收款账户信息合法性校验
     *
     * @return
     */
    public static String checkHistoryPaycardInfo(HistoryPaycardRequest historyPaycardRequest) {
        if (StringUtils.isNotBlank(historyPaycardRequest.getPlatformType())) {
            if (!("A".equals(historyPaycardRequest.getPlatformType()) || "iPhone"
                    .equals(historyPaycardRequest.getPlatformType()))) {
                return "平台类型不合法";
            }
        } else {
            return "输入项必填";
        }
        if (StringUtils.isBlank(historyPaycardRequest.getAppUserId())) {
            return "输入项必填";
        }

        return null;
    }

    /**
     * 历史收款账户信息信息
     *
     * @param historyPaycardRequest
     * @return
     */
    public static HistoryPaycardInfoResponse getHistoryPaycardResponse(
            HistoryPaycardRequest historyPaycardRequest) {
        HistoryPaycardInfoResponse historyPaycardInfoResponse = new HistoryPaycardInfoResponse();
        historyPaycardInfoResponse.setReturnCode("0000");
        historyPaycardInfoResponse.setReturnMsg("历史收款账户信息获取成功");
        return historyPaycardInfoResponse;
    }
}
